package model

import "fmt"

// Customer 一个客户的信息
type Customer struct {
	Id     int
	Name   string
	Gender string
	Age    int
	Tel    string
	Email  string
}

// NewCustomer 工厂模式，返回一个customer的类
func NewCustomer(id int, name string, gender string, age int, tel string, email string) Customer {
	return Customer{
		Id:     id,
		Name:   name,
		Gender: gender,
		Age:    age,
		Tel:    tel,
		Email:  email,
	}
}

func (customer Customer) String() string {
	return fmt.Sprintf("%d\t%s\t%s\t%d\t%s\t%s\n", customer.Id, customer.Name, customer.Gender,
		customer.Age, customer.Tel, customer.Email)
}
